﻿<!DOCTYPE html>
<!--简易吊装作业安全许可证管理-->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <style>
        .el-dialog__body {
            height: 100% !important;
        }

        .el-dialog.is-fullscreen {
            overflow: hidden !important;
        }
 

        body {
            padding-bottom: 10px;
        }

        
        .el-col,td {
            padding: 10px!important;
            font-size: 14px!important;
        }

        td {
            padding: 0 10px;
            font-size: 14px;
        }

        .el-form-item {
            margin-bottom: 0px !important;
        }

        .el-input-group__prepend {
            color: #000;
            font-size: 14px;
        }

        .el-input__inner {
            color: #606266;
            font-size: 14px;
        }

        .el-input-group__prepend ,.el-form-item__label{
            padding-left: 0!important;
            color: #000
        }

        .el-input--mini .el-input__inner {
            height: 20px;
            line-height: 28px;
        }
    </style>
</head>
<body>
    
<div id="app" v-cloak>   
        <div style="width:100%;text-align:center ">
            <label style="font-weight:bold">简易吊装作业安全许可证管理</label>
        </div>

        <div style="width:100%;text-align:right ">
            <label>   {{SimpleLiftingOperation.ApplicationNumber+mark.m}} {{Form.ApplicationNumber}}</label>
        </div>


        <el-form :model="Form" status-icon style="margin-top:5px;width:100%" class="safeCard">

            <table style="border:1px  solid; width:100%" cellpadding="0" cellspacing="0">
                <tr>
                    <td width="8%" rowspan="6" style="text-align:center;border-right:1px solid ">工作内容</td>
                    <td width="46%" style="border-right:1px solid;border-bottom:1px solid  ">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input size="mini">
                                    <template slot="prepend">
                                        <div>{{SimpleLiftingOperation.OperatingUnit+mark.m}}</div>
                                    </template>
                                    <el-select @visible-change="visibleChange" v-model="Form.OperatingUnit" slot="suffix" :placeholder="SimpleLiftingOperation.OperatingUnit">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option v-for="item in OperatingUnit" :label="item.value" :value="item.key">
                                        </el-option>
                                    </el-select>
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                    <td width="46%" style="border-bottom:1px solid">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input size="mini">
                                    <template slot="prepend">
                                        <div>{{SimpleLiftingOperation.TerritorialDepartment+mark.m}}</div>
                                    </template>
                                    <el-select @visible-change="visibleChange" v-model="Form.TerritorialDepartment" slot="suffix" :placeholder="SimpleLiftingOperation.TerritorialDepartment">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option v-for="item in TerritorialDepartment" :label="item.value" :value="item.key">
                                        </el-option>
                                    </el-select>
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                </tr>

                <tr style="border:1px  solid;">
                    <td width="46%" style="border-right:1px solid;border-bottom:1px solid  ">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input type="text" v-model="Form.JobLocation" autocomplete="off" size="mini">
                                    <template slot="prepend">
                                        {{SimpleLiftingOperation.JobLocation+mark.m}}
                                    </template>
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                    <td width="46%" style="border-bottom:1px solid">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input type="text" v-model="Form.applicant" autocomplete="off" size="mini">
                                    <template slot="prepend">
                                        {{SimpleLiftingOperation.applicant+mark.m}}
                                    </template>
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                </tr>

                <tr>
                    <td colspan="2" style="border-bottom:1px solid;">
                        <el-form-item :label="SimpleLiftingOperation.LiftingContentDescription+mark.m">
                            <el-input type="textarea" v-model="Form.LiftingContentDescription"></el-input>
                        </el-form-item>
                    </td>
                </tr>
                <tr>
                    <td width="46%" style="border-bottom:1px solid;border-right:1px solid  ">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input type="text" v-model="Form.CraneRatedLoad" autocomplete="off" size="mini">
                                    <template slot="prepend">
                                        {{SimpleLiftingOperation.CraneRatedLoad+mark.m}}
                                    </template>
                                </el-input>
                            </el-form-item>

                        </div>
                    </td>


                    <td width="46%" style="border-bottom:1px solid">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input type="text" v-model="Form.MaximumWeightObject" autocomplete="off" size="mini">
                                    <template slot="prepend">
                                        {{SimpleLiftingOperation.MaximumWeightObject+mark.m}}
                                    </template>
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>

                </tr>

                <tr style="border:1px  solid;">
                    <td width="46%" style="border-right:1px solid;border-bottom:1px solid ; padding-left:10px; padding-top:15px ">
                        <el-form-item :label="SimpleLiftingOperation.IsPre_workSafetyAnalysis+mark.m" prop="IsConsumables">
                        </el-form-item>
                    </td>
                    <td width="46%" style="border-bottom:1px solid ;  ">
                        <el-radio-group v-model="Form.IsPre_workSafetyAnalysis" style="margin-top:13px">
                            <el-radio v-for="item in IsDevelopSafetyPlan" :label="item.value" :value="item.key">{{item.value}}</el-radio>
                        </el-radio-group>
                    </td>
                </tr>
                <tr>
                    <td width="30%">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input size="mini">
                                    <template slot="prepend">
                                        <div>{{SimpleLiftingOperation.contractor+mark.m}}</div>
                                    </template>
                                    <el-select @visible-change="visibleChange" v-model="Form.contractor" slot="suffix" :placeholder="SimpleLiftingOperation.contractor">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option v-for="item in contractor" :label="item.value" :value="item.key">
                                        </el-option>
                                    </el-select>
                                </el-input>
                            </el-form-item>
                        </div>
                    </td>
                    <td width="62%"></td>
                </tr>
            </table>

            <el-row style="border:1px  solid; border-top:0px;    ">
                <el-col span="24" style="  padding-left:30px; ">
                    <el-table :data="Form.HazardIdentification" border>
                        <el-table-column type="index" :label="JobLicenseManagement.SerialNumber"
                                         :index="indexMethod" width="50" show-overflow-tooltip="true"></el-table-column>

                        <el-table-column prop="SafetyMeasures"
                                         :label="SimpleLiftingOperation.SafetyMeasures">
                        </el-table-column>

                        <el-table-column :label="SimpleLiftingOperation.Department" width="180px">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.Department" placeholder="请选择">
                                    <el-option v-for="item in TerritorialDepartment" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column :label="SimpleLiftingOperation.Confirmor" width="130px">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.Confirmor" placeholder="请选择">
                                    <el-option v-for="item in Confirmor" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
            <!--基于数据库管控要求-->
            <!--<el-row style="border:1px  solid;border-top:0px;  ">
        <el-col span="24">
            <label>{{SimpleLiftingOperation.BasedDatabaseManagementRequirements+mark.m}}</label>
            <a href="javascript:void(0)" v-on:click="RiskInformationBase('tj')">添加</a>
        </el-col>
    </el-row>
    <el-row style="border:1px  solid; border-top:0px;    ">
        <el-col span="24" style="  padding-left:30px; ">
            <el-table :data="Form.BasedDatabaseManagementRequirements"
                      border
                      style="width: 90%">
                <el-table-column prop="Risk"
                                 :label="EquipmenFacilities.Risk">
                </el-table-column>
                <el-table-column prop="ControlRequirement"
                                 :label="SimpleLiftingOperation.ControlRequirements">
                </el-table-column>

                <el-table-column :label="SimpleLiftingOperation.ControlDepartment" width="180px">
                    <template slot-scope="scope">
                        <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.ControlDepartment" placeholder="请选择">
                            <el-option v-for="item in TerritorialDepartment" :key="item.key" :label="item.value" :value="item.key"></el-option>
                        </el-select>
                    </template>
                </el-table-column>
                <el-table-column :label="SimpleLiftingOperation.ControlConfirmor" width="130px">
                    <template slot-scope="scope">
                        <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.ControlConfirmor" placeholder="请选择">
                            <el-option v-for="item in Confirmor" :key="item.key" :label="item.value" :value="item.key"></el-option>
                        </el-select>
                    </template>
                </el-table-column>
            </el-table>
        </el-col>
    </el-row>-->

            <el-row style="border:1px  solid;border-top:0px; text-align: left ">
                <el-col span="24">
                    <label>{{SimpleLiftingOperation.Approver+mark.m}}</label><a href="javascript:void(0)" @click="ApproverInput('tj')">添加</a>
                </el-col>
            </el-row>
            <el-row style="border:1px  solid; border-top:0px;    ">
                <el-col span="24" style="  padding-left:30px; ">
                    <el-table :data="Form.Approver" border>
                        <el-table-column :label="SimpleLiftingOperation.ApproverUnit">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.ApproverUnit" placeholder="请选择">
                                    <el-option v-for="item in OperatingUnit" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column :label="SimpleLiftingOperation.ApproverConfirmor">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.ApproverConfirmor" placeholder="请选择">
                                    <el-option v-for="item in Confirmor" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column label="操作">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.Approver)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>

            <el-row style="border:1px  solid;border-top:0px;text-align: left  ">
                <el-col span="24">
                    <label>{{SimpleLiftingOperation.LiftingOperator+mark.m}}</label><a href="javascript:void(0)" @click="LiftingOperatorInput('tj')">添加</a>
                </el-col>
            </el-row>
            <el-row style="border:1px  solid; border-top:0px;    ">
                <el-col span="24" style="  padding-left:30px; ">
                    <el-table :data="Form.LiftingOperator"border>
                        <el-table-column :label="SimpleLiftingOperation.LiftingUnit">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.LiftingUnit" placeholder="请选择">
                                    <el-option v-for="item in OperatingUnit" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column :label="SimpleLiftingOperation.LiftingConfirmor">
                            <template slot-scope="scope">
                                <el-select @visible-change="visibleChange" @change="handleSelect" v-model="scope.row.LiftingConfirmor" placeholder="请选择">
                                    <el-option v-for="item in Confirmor" :key="item.key" :label="item.value" :value="item.key"></el-option>
                                </el-select>
                            </template>
                        </el-table-column>
                        <el-table-column label="操作">
                            <template slot-scope="scope">
                                <el-button @click.native.prevent="deleteRow(scope.$index, Form.LiftingOperator)"
                                           type="text"
                                           size="small">
                                    移除
                                </el-button>
                            </template>
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>
            <el-row>
                <el-form-item style="text-align:center; padding-top:5px">
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnCommit}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
        <el-dialog :title="title" :visible.sync="ListItem.dialogVisible" width="90%" height="95%" top="10vh" fullscreen="true">

            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        app = new Vue({
            el: '#app',
            data: {
                id: '',
                title:'',
                Form: {
                    id: guidEmpty,
                    OperatingUnit: '',//作业单位
                    ApplicationNumber: '',//申请编号
                    ApplicationTime: '',//申请时间
                    OperatingName: '',//"作业名称",
                    JobManagere: '',//作业负责人
                    JobLocation: '',//作业地点
                    JobStartTime: '',//作业起始时间
                    JobEndTime: '',//有效截至时间
                    TerritorialDepartment: '',//属地部门
                    CurrentJob: '',//当前作业
                    Level: '',//等级
                    HoistingPersonnel: '',//吊装人员及特殊工种作业证号
                    HoistingCommander: '',//吊装指挥人及特殊工种作业证号
                    LiftingContentDescription: '',//LiftingContentDescription
                    CraneRatedLoad: '',//起重机额定载荷
                    MaximumWeightObject: '',//被吊物最大重量
                    IsPre_workSafetyAnalysis: '',//是否已制定吊装作业安全方案
                    LiftingToolName: '',//吊装工具名称
                    InvolvingOtherSpecialOperations: '',//涉及其他特殊作业
                    contractor: '',//承包商
                    HazardIdentification: '',//危害辨识
                    BasedDatabaseManagementRequirements: '',//基于数据库管控要求
                    Approver: '',//审批人
                    LiftingOperator: '',//吊装作业人
                    HoistingGuardian: '',//吊装监护人
                    RelatedForm: '',//相关表格
                },
                TerritorialDepartment: [],
                Level: [],
                IsDevelopSafetyPlan: [],
                contractor: [],
                Confirmor: [],
                OperatingUnit: [],
                rules: {},
                BasedDatabaseManagementRequirements: [],
                ListItem: ListItem,
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                indexMethod: function (index) {
                    return (this.ListItem.currentPage - 1) * this.ListItem.pagesize + index + 1;
                },
                handleNodeClick: function (data) {
                    console.log(data);
                },
                handleSelect: function(ev) {
                    console.log(ev);
                },
                handleChecked: function (value) {
                },
                handleCheckedConfirmation: function (value) {
                },
                deleteRow: function (index, rows) {
                    rows.splice(index, 1);
                },
                getData: function () {
                    getDataAdd(this, '/api/SimpleLiftingOperation/get?id=' + this.id);
                },
                ApproverInput: function (val, id) {
                    this.title = "审批人管理";
                    DialogShow(this, val, "../GeneralLiftingWorkSafety/ApproverInput.html", id);
                },
                LiftingOperatorInput: function (val, id) {
                    this.title = "吊装作业人管理";
                    DialogShow(this, val, "../GeneralLiftingWorkSafety/LiftingOperatorInput.html", id);
                },
                RiskInformationBase: function (val, id) {
                    this.title = "基于数据库管控要求管理";
                    DialogShow(this, val, "../GeneralLiftingWorkSafety/RiskInformationBase.html", id);
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    //this.$refs[formName].validate(function (valid) {
                    //    //验证通过
                    //    if (valid) {
                    onSubmitForm(this, '/api/SimpleLiftingOperation/Save', mythis.Form);
                    //} else {
                    //    //验证失败
                    //    return false;
                    //}
                    //});
                },
            },
            mounted: function () {
                var list = getDicDataArray(['14', '03', '50', '12', '09', '08']);
                this.OperatingUnit = getDicDatafromArray('08', list);
                this.TerritorialDepartment = getDicDatafromArray('14', list);//工作类型
                this.Level = getDicDatafromArray('03', list);//工作类型
                this.IsDevelopSafetyPlan = getDicDatafromArray('50', list);//工作类型
                this.contractor = getDicDatafromArray('12', list);//工作类型
                this.Confirmor = getDicDatafromArray("09", list);//批准人
                this.id = getUrlParam("id");
                this.getData();
                //this.BasedDatabaseManagementRequirements = this.Form.BasedDatabaseManagementRequirements;
            }
        });
    </script>
</body>
</html>